package com.game.entities;

import com.almasb.fxgl.core.math.FXGLMath;
import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.EntityFactory;
import com.almasb.fxgl.entity.components.CollidableComponent;
import com.game.enums.EntityType;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

/**
 * Copyright (C), 2021-2041, chenc 豫R7HQ53
 *
 * @author: chenc
 * Date:     2023/11/29 21:12
 * Description:
 */
public class BoxEntityFactory implements EntityFactory {

    public static void createEnergy(){
        FXGL.entityBuilder()
                .type(EntityType.ENEMY)
                .at(FXGLMath.random(20,800-20),FXGLMath.random(40,600-40))
                .viewWithBBox(new Rectangle(70,40, Color.web("#fef345")))
                .with(new CollidableComponent(true))
                .buildAndAttach();
    }
}
